﻿using System;
using System.Collections.Generic;
using System.Text;
using Volo.Abp;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;

namespace mozhi.smarterp.Finance.AccountsPayables
{
    public class PurchasePayableReceipt : AuditedAggregateRoot<Guid> , IMultiTenant
    {
        public Guid? TenantId { get; private set; }

        public Guid PayableId { get; private set; }

        public Guid PayableItemId { get; private set; }

        public Guid ReceiptId { get; private set; }

        public Guid ReceiptItemId { get; private set; }

        private PurchasePayableReceipt() { }

        public PurchasePayableReceipt(Guid id, Guid payableId, Guid payableItemId, Guid receiptId, Guid receiptItemId)
        {
            Id = id;
            PayableId = payableId;
            PayableItemId = payableItemId;
            ReceiptId = receiptId;
            ReceiptItemId = receiptItemId;

            Validate();
        }

        #region
        private void Validate()
        {
            Check.NotDefaultOrNull<Guid>(PayableId, nameof(PayableId));
            Check.NotDefaultOrNull<Guid>(PayableItemId, nameof(PayableItemId));
            Check.NotDefaultOrNull<Guid>(ReceiptId, nameof(ReceiptId));
            Check.NotDefaultOrNull<Guid>(ReceiptItemId, nameof(ReceiptItemId));
        }
        #endregion
    }
}
